/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package clases;

import java.awt.Color;
import javax.swing.table.DefaultTableCellRenderer;
import java.awt.Component;
import java.awt.Font;
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.SwingConstants;

/**
 *
 * @author Rolando
 */
public class ClsRenderAportesLlenada extends DefaultTableCellRenderer {

    @Override
    public Component getTableCellRendererComponent(JTable table, Object value, boolean selected, boolean focused, int row, int column) {


//        if (row % 2 == 0) {
//            setBackground(new java.awt.Color(255, 255, 255));
//        } else {
//            setBackground(new java.awt.Color(242, 242, 242));
//        }
        //setBackground(new java.awt.Color(155, 194, 230));
        if (column == 8) {
            setBackground(new java.awt.Color(112, 173, 71));
            System.out.println("holasss");
        } else  if (column != 8){
            if (row % 2 == 0) {
                setBackground(new java.awt.Color(255, 255, 255));
            } else {
                setBackground(new java.awt.Color(242, 242, 242));
            }
        }
//        setBackground(new java.awt.Color(155, 194, 230));
        if (column == 2) {
            if (value instanceof JLabel) {
                JLabel label = (JLabel) value;
                label.setOpaque(true);
                //fillColor(table, label, selected);
                return label;
            }
        }
        super.getTableCellRendererComponent(table, value, selected, focused, row, column);
        return this;
    }
}